<html>
<head><meta charset="utf-8"><title>vscode_debug · t-compiler/rust-analyzer · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/index.html">t-compiler/rust-analyzer</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/vscode_debug.html">vscode_debug</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="186625120"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/vscode_debug/near/186625120" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> std::Veetaha <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/vscode_debug.html#186625120">(Jan 26 2020 at 15:00)</a>:</h4>
<p>I am debugging ra_lsp_server with vscode. I've caught a panic, but cannot step into source code, all functions in the callstack are shown only in assembly language. Does someone know how to switch to source code here?<br>
<a href="/user_uploads/4715/0KpLRZhhigtebao2J5YUe_jY/pasted_image.png" target="_blank" title="pasted_image.png">pasted image</a></p>
<div class="message_inline_image"><a href="/user_uploads/4715/0KpLRZhhigtebao2J5YUe_jY/pasted_image.png" target="_blank" title="pasted image"><img src="/user_uploads/4715/0KpLRZhhigtebao2J5YUe_jY/pasted_image.png"></a></div>



<a name="186625128"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/vscode_debug/near/186625128" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/vscode_debug.html#186625128">(Jan 26 2020 at 15:00)</a>:</h4>
<p>Did you compile with debug info?</p>



<a name="186625142"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/vscode_debug/near/186625142" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> std::Veetaha <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/vscode_debug.html#186625142">(Jan 26 2020 at 15:01)</a>:</h4>
<p>I just ran <code>cargo build</code>. Doesn't it compile with debug symbols enabled?</p>



<a name="186625147"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/vscode_debug/near/186625147" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/vscode_debug.html#186625147">(Jan 26 2020 at 15:01)</a>:</h4>
<p>nope: <a href="https://github.com/rust-analyzer/rust-analyzer/blob/master/Cargo.toml#L7" target="_blank" title="https://github.com/rust-analyzer/rust-analyzer/blob/master/Cargo.toml#L7">https://github.com/rust-analyzer/rust-analyzer/blob/master/Cargo.toml#L7</a></p>



<a name="186625199"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/vscode_debug/near/186625199" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> std::Veetaha <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/vscode_debug.html#186625199">(Jan 26 2020 at 15:02)</a>:</h4>
<p>Oh, thanks! By the way, the project already takes 13GB, I wonder how much it would take with debug symbols)</p>



<a name="186625256"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/vscode_debug/near/186625256" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/vscode_debug.html#186625256">(Jan 26 2020 at 15:04)</a>:</h4>
<p>If you use <code>debug = 1</code>, instead of the default <code>debug = 2</code> , it will only add lineinfo, but not info required to show locals, etc</p>



<a name="186625260"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/vscode_debug/near/186625260" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/vscode_debug.html#186625260">(Jan 26 2020 at 15:05)</a>:</h4>
<p>You can also use <code>[profile.dev.package.abc]</code> to only change settings for crate <code>abc</code></p>



<a name="186625272"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/vscode_debug/near/186625272" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> std::Veetaha <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/vscode_debug.html#186625272">(Jan 26 2020 at 15:05)</a>:</h4>
<p>Can you please hint me if there is a cli option for <code>cargo</code> for debug level?</p>



<a name="186625324"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/vscode_debug/near/186625324" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/vscode_debug.html#186625324">(Jan 26 2020 at 15:06)</a>:</h4>
<p>No, you can use <code>RUSTFLAGS="-Cdebuginfo=1"</code> or <code>RUSTFLAGS="-Cdebuginfo=2"</code> though</p>



<a name="186625339"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/vscode_debug/near/186625339" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> std::Veetaha <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/vscode_debug.html#186625339">(Jan 26 2020 at 15:07)</a>:</h4>
<p>Okay, thanks!</p>



<a name="186629081"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/vscode_debug/near/186629081" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> std::Veetaha <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/vscode_debug.html#186629081">(Jan 26 2020 at 17:01)</a>:</h4>
<p>Guys, how do you debug unit tests in vscode? I see that test binaries a very hard to take apart from other binaries. The only way I see now is running <code>cargo test --no-run --message-format=json &gt; artifacts.json</code>, then manually looking up the test binary name and setting it in <code>launch.json</code> (I think I'd write a script for this)</p>



<a name="186629370"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/vscode_debug/near/186629370" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/vscode_debug.html#186629370">(Jan 26 2020 at 17:08)</a>:</h4>
<p>I’d say the easiest would be to teach rust-analyzer to generate appropriate<br>
debugger invocation, and then just using this feature :)</p>



<a name="186629445"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/vscode_debug/near/186629445" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> std::Veetaha <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/vscode_debug.html#186629445">(Jan 26 2020 at 17:10)</a>:</h4>
<p>Yeah, <code>Debug test</code> right near <code>Run test</code> button would be super helpful )</p>



<a name="186629693"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/vscode_debug/near/186629693" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> std::Veetaha <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/vscode_debug.html#186629693">(Jan 26 2020 at 17:17)</a>:</h4>
<p>Hmm, I found a good extension dedicated just for that <a href="https://github.com/hdevalke/rust-test-lens" target="_blank" title="https://github.com/hdevalke/rust-test-lens">https://github.com/hdevalke/rust-test-lens</a></p>



<a name="186635798"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/vscode_debug/near/186635798" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> std::Veetaha <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/vscode_debug.html#186635798">(Jan 26 2020 at 20:02)</a>:</h4>
<p><span class="user-mention" data-user-id="133169">@matklad</span> To my mind we should integrate this <code>Debug test</code> functionality directly into <code>rust-analyzer</code>. What do you think?</p>



<a name="186666952"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/vscode_debug/near/186666952" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/vscode_debug.html#186666952">(Jan 27 2020 at 09:56)</a>:</h4>
<p>We absolutely should</p>



<a name="186666980"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/vscode_debug/near/186666980" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/vscode_debug.html#186666980">(Jan 27 2020 at 09:57)</a>:</h4>
<p>The problem is that this is not expressible in the LSP protocol (and even in the VS Code API), so that would need some custom code to handle</p>



<a name="186667100"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/vscode_debug/near/186667100" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/vscode_debug.html#186667100">(Jan 27 2020 at 09:59)</a>:</h4>
<p>Moreover, I would love to see this implemented in a very generic manner, like "the server specifies the command line to invoke something, the debugger than injects its stuff into the command line", but that doesn't work out naturally, as you don't know the name of the output file with tests beforehand</p>



<a name="186667189"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/vscode_debug/near/186667189" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/vscode_debug.html#186667189">(Jan 27 2020 at 10:00)</a>:</h4>
<p>So, we need this whole dance with "execute once with --message-format=json, then build the command line invocation", and it's not clear what's the best way to implement this. Like, which parts are in the client, which parts are in the server</p>



<a name="186667223"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/vscode_debug/near/186667223" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> std::Veetaha <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/vscode_debug.html#186667223">(Jan 27 2020 at 10:00)</a>:</h4>
<p>The extension I provided the link to does this purely without the LSP. We could roughly copy-paste that code)</p>



<a name="186667293"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/vscode_debug/near/186667293" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> std::Veetaha <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/vscode_debug.html#186667293">(Jan 27 2020 at 10:01)</a>:</h4>
<p>I personally am very well acquainted with TypeScript, so it would be a jiffy</p>



<a name="186667354"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/vscode_debug/near/186667354" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/vscode_debug.html#186667354">(Jan 27 2020 at 10:02)</a>:</h4>
<p>I think we should at least keep test discovery on the server side (because that would be able to deal with proc macros one day)</p>



<a name="186667370"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/vscode_debug/near/186667370" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/vscode_debug.html#186667370">(Jan 27 2020 at 10:02)</a>:</h4>
<p>So I think we should rather extend the current code for "runnables"</p>



<a name="186667559"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/vscode_debug/near/186667559" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> std::Veetaha <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/vscode_debug.html#186667559">(Jan 27 2020 at 10:05)</a>:</h4>
<p>Okay, I am not yet into higher-level stuff of our LSP, but nevertheless, this needs more thorough investigation. I'll create an issue for that, I guess.</p>



<a name="186667738"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/vscode_debug/near/186667738" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/vscode_debug.html#186667738">(Jan 27 2020 at 10:07)</a>:</h4>
<p>The relevant bits are</p>
<ul>
<li><a href="https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ra_ide/src/runnables.rs" target="_blank" title="https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ra_ide/src/runnables.rs">https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ra_ide/src/runnables.rs</a></li>
<li><a href="https://github.com/rust-analyzer/rust-analyzer/blob/master/editors/code/src/commands/runnables.ts" target="_blank" title="https://github.com/rust-analyzer/rust-analyzer/blob/master/editors/code/src/commands/runnables.ts">https://github.com/rust-analyzer/rust-analyzer/blob/master/editors/code/src/commands/runnables.ts</a></li>
</ul>



<a name="186667927"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/vscode_debug/near/186667927" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> std::Veetaha <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/vscode_debug.html#186667927">(Jan 27 2020 at 10:10)</a>:</h4>
<p>Thanks! And just FYI, I found the link to the extension from this issue:<br>
<a href="https://github.com/rust-analyzer/rust-analyzer/issues/2593" target="_blank" title="https://github.com/rust-analyzer/rust-analyzer/issues/2593">https://github.com/rust-analyzer/rust-analyzer/issues/2593</a></p>



<a name="186675745"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/vscode_debug/near/186675745" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pachi <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/vscode_debug.html#186675745">(Jan 27 2020 at 12:10)</a>:</h4>
<p><span class="user-mention" data-user-id="258149">@std::Veetaha</span> <span class="user-mention" data-user-id="133169">@matklad</span>  Maybe this interests you. The "Rust test lens" extension for VSCode is very nice for debugging (or running) just a test from the code, which is, AFAICT, what you're looking for. The extension repo is at <a href="https://github.com/hdevalke/rust-test-lens" target="_blank" title="https://github.com/hdevalke/rust-test-lens">https://github.com/hdevalke/rust-test-lens</a></p>



<a name="186684887"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/vscode_debug/near/186684887" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> std::Veetaha <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/vscode_debug.html#186684887">(Jan 27 2020 at 14:16)</a>:</h4>
<p><span class="user-mention" data-user-id="125416">@pachi</span>, thanks for the link, though I already mentioned it higher in the discussion)</p>



<a name="186685957"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/vscode_debug/near/186685957" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pachi <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/vscode_debug.html#186685957">(Jan 27 2020 at 14:27)</a>:</h4>
<p>Oh, sorry for the noise, then. I read your message yesterday while on the phone and tried to send the information today just in case.</p>



<a name="187156882"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/vscode_debug/near/187156882" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> std::Veetaha <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/vscode_debug.html#187156882">(Feb 01 2020 at 10:26)</a>:</h4>
<p><span class="user-mention" data-user-id="133169">@matklad</span> , I've read about <a href="https://github.com/rust-analyzer/rust-analyzer/pull/2940/files" target="_blank" title="https://github.com/rust-analyzer/rust-analyzer/pull/2940/files">your debugging workflow</a>. It seems that you are unaware of VSCode <code>logpoints</code>, these are just like debugger breakpoints, but the debugger doesn't stop at them, but instead logs an expression at that point. It means you don't have to literally put <code>dbg!()</code> expressions into the code and recompile it, but just put a logpoint there and rerun the already compiled binary.<br>
<a href="/user_uploads/4715/Jq0SK7TBCADfNTqYk_rUGiQW/logpoints.gif" target="_blank" title="logpoints.gif">logpoints.gif</a></p>
<div class="message_inline_image"><a href="/user_uploads/4715/Jq0SK7TBCADfNTqYk_rUGiQW/logpoints.gif" target="_blank" title="logpoints.gif"><img src="/user_uploads/4715/Jq0SK7TBCADfNTqYk_rUGiQW/logpoints.gif"></a></div>



<a name="187157765"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/vscode_debug/near/187157765" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Emil Lauridsen <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/vscode_debug.html#187157765">(Feb 01 2020 at 10:56)</a>:</h4>
<p>That is so cool and useful, thanks for sharing</p>



<a name="187162787"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/vscode_debug/near/187162787" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/vscode_debug.html#187162787">(Feb 01 2020 at 13:45)</a>:</h4>
<p>Indeed I am not aware of that, that's cool, thanks for sharing! Do they work with <code>Debug</code> impls, or only with build-in pretty-printers?</p>



<a name="187162833"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/vscode_debug/near/187162833" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/vscode_debug.html#187162833">(Feb 01 2020 at 13:46)</a>:</h4>
<p>They probably only work with build-in pretty-printers</p>



<a name="187164114"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/vscode_debug/near/187164114" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> std::Veetaha <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/vscode_debug.html#187164114">(Feb 01 2020 at 14:31)</a>:</h4>
<p>I personally don't have idea, it uses some python scripting underneath, so that to get the length of <code>Vec&lt;T&gt;</code> you have to type <code>len(vec)</code> instead of <code>vec.len()</code></p>



<a name="187164152"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/vscode_debug/near/187164152" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> std::Veetaha <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/vscode_debug.html#187164152">(Feb 01 2020 at 14:32)</a>:</h4>
<p>This is the problem of watching expressions at all, they somehow use python syntax but not rust</p>



<a name="187164228"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/vscode_debug/near/187164228" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> std::Veetaha <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/vscode_debug.html#187164228">(Feb 01 2020 at 14:35)</a>:</h4>
<p>For example, when I try to evaluate a + b, both i32, it says <code>&lt;not available&gt;</code></p>



<a name="187164229"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/vscode_debug/near/187164229" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> std::Veetaha <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/vscode_debug.html#187164229">(Feb 01 2020 at 14:35)</a>:</h4>
<p>But <code>int(a) + int(b)</code> works. Its something weird like <code>a</code> and <code>b</code> are python strings<br>
<a href="user_uploads/4715/INrZsPg5IlQbHDtP7kHCtIb2/pasted_image.png" target="_blank" title="user_uploads/4715/INrZsPg5IlQbHDtP7kHCtIb2/pasted_image.png">pasted image</a></p>
<div class="message_inline_image"><a href="user_uploads/4715/INrZsPg5IlQbHDtP7kHCtIb2/pasted_image.png" target="_blank" title="pasted image"><img src="user_uploads/4715/INrZsPg5IlQbHDtP7kHCtIb2/pasted_image.png"></a></div>



<a name="189157893"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/vscode_debug/near/189157893" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> std::Veetaha <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/vscode_debug.html#189157893">(Feb 26 2020 at 20:54)</a>:</h4>
<p>Does one know a legal way to debug <code>rust-analyzer</code> from the entrypoint (i.e. not to attach the debugger in the middle of running the <code>main_loop</code>, but from the beginning)?</p>



<a name="189159053"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/vscode_debug/near/189159053" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/vscode_debug.html#189159053">(Feb 26 2020 at 21:06)</a>:</h4>
<p>Put a <code>thread::sleep</code> at the beginning of <code>main</code>? <span aria-label="sweat smile" class="emoji emoji-1f605" role="img" title="sweat smile">:sweat_smile:</span></p>



<a name="189159404"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/vscode_debug/near/189159404" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> std::Veetaha <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/vscode_debug.html#189159404">(Feb 26 2020 at 21:10)</a>:</h4>
<p>I found a better solution, though still illegal:<br>
<a href="/user_uploads/4715/1Qg-7M0dsZqOUNRLu7HJ2aX-/image.png" target="_blank" title="image.png">image.png</a></p>
<div class="message_inline_image"><a href="/user_uploads/4715/1Qg-7M0dsZqOUNRLu7HJ2aX-/image.png" target="_blank" title="image.png"><img src="/user_uploads/4715/1Qg-7M0dsZqOUNRLu7HJ2aX-/image.png"></a></div>



<a name="189159581"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/vscode_debug/near/189159581" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/vscode_debug.html#189159581">(Feb 26 2020 at 21:12)</a>:</h4>
<p><code>sleep</code> might be better because it doesn't require you to change a variable value or the next instruction using the debugger</p>



<a name="189159656"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/vscode_debug/near/189159656" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/vscode_debug.html#189159656">(Feb 26 2020 at 21:12)</a>:</h4>
<p><a href="https://doc.rust-lang.org/std/intrinsics/fn.breakpoint.html" target="_blank" title="https://doc.rust-lang.org/std/intrinsics/fn.breakpoint.html">https://doc.rust-lang.org/std/intrinsics/fn.breakpoint.html</a></p>



<a name="189159798"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/vscode_debug/near/189159798" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/vscode_debug.html#189159798">(Feb 26 2020 at 21:13)</a>:</h4>
<p>5 seconds or so should be enough to attach a debugger</p>



<a name="192719520"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/vscode_debug/near/192719520" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> std::Veetaha <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/vscode_debug.html#192719520">(Apr 02 2020 at 20:11)</a>:</h4>
<p>Hey guys, does anyone have a problem  with taking screenshots of on-hover hints in vscode (Ubuntu)? I remember some time ago this worked well. But something changed and I can no longer make partial screenshots of hover info because it disappears once I press <code>Shift+PrtSc</code> in vscode and this drives me mad...<br>
<a href="/user_uploads/4715/yssOxHxzequ0RWinAMe6eHCE/screen.gif" title="screen.gif">screen.gif</a></p>
<div class="message_inline_image"><a href="/user_uploads/4715/yssOxHxzequ0RWinAMe6eHCE/screen.gif" title="screen.gif"><img src="/user_uploads/4715/yssOxHxzequ0RWinAMe6eHCE/screen.gif"></a></div>



<a name="192725348"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/vscode_debug/near/192725348" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jeremy Kolb <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/vscode_debug.html#192725348">(Apr 02 2020 at 20:59)</a>:</h4>
<p>it works in windows</p>



<a name="192725405"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/vscode_debug/near/192725405" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jeremy Kolb <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/vscode_debug.html#192725405">(Apr 02 2020 at 20:59)</a>:</h4>
<p>i've seen a lot of weirdness with vscode in my ubuntu vm though.</p>



<a name="192725458"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/vscode_debug/near/192725458" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jeremy Kolb <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/vscode_debug.html#192725458">(Apr 02 2020 at 20:59)</a>:</h4>
<p>white menus etc. there are definitely electron issues</p>



<a name="192769949"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/vscode_debug/near/192769949" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/vscode_debug.html#192769949">(Apr 03 2020 at 08:11)</a>:</h4>
<p>It works for me on Gnome Wayland / Arch Linux:</p>
<p><a href="/user_uploads/4715/9AaYgQlzOShlhqwg9WBh7xWN/image.png" title="image.png">image.png</a></p>
<div class="message_inline_image"><a href="/user_uploads/4715/9AaYgQlzOShlhqwg9WBh7xWN/image.png" title="image.png"><img src="/user_uploads/4715/9AaYgQlzOShlhqwg9WBh7xWN/image.png"></a></div>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>